package com.bnzj.cloud.auth.config;

import com.bnzj.cloud.auth.extend.AuthServerLoginTypeHandler;
import com.bnzj.cloud.auth.extend.BCryptPasswordEncoderExtend;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @ClassName AuthServerConfiguration
 * @Description 配合第三方方式登录
 * @Author
 * @Date 2020/3/24
 * @Version V1.0
 **/
@Configuration
public class AuthServerConfiguration {

    @Bean
    public AuthServerLoginTypeHandler authServerLoginTypeHandler(){
        return new AuthServerLoginTypeHandler();
    }

    @Bean
    public PasswordEncoder customPasswordEncoder(){
        return new BCryptPasswordEncoderExtend(12);
    }


    public static void main(String[] args){
        PasswordEncoder encoder = new BCryptPasswordEncoderExtend(12);

        System.out.println(encoder.encode("123456"));
    }

}
